//
//  TableViewCell.m
//  tableviewCellSelect
//
//  Created by 廖幸杰 on 2017/2/14.
//  Copyright © 2017年 刘光军. All rights reserved.
//

#import "TableViewCell.h"

@implementation TableViewCell

- (void)setEditing:(BOOL)editing animated:(BOOL)animated{
    [super setEditing:editing animated:animated];
    for (UIControl *control in self.subviews){
        if ([control isMemberOfClass:NSClassFromString(@"UITableViewCellEditControl")]){
            for (UIView *v in control.subviews)
            {
                if ([v isKindOfClass: [UIImageView class]]) {
                    UIImageView *img=(UIImageView *)v;

                    if (!self.selected) {
                        img.image=[UIImage imageNamed:@"circle_default_status"];
                        
                    }
                }
            }
        }
    }
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    for (UIControl *control in self.subviews){
        if ([control isMemberOfClass:NSClassFromString(@"UITableViewCellEditControl")]){
            for (UIView *v in control.subviews)
            {
                if ([v isKindOfClass: [UIImageView class]]) {
                    UIImageView *img=(UIImageView *)v;
                    if (!self.selected) {
                        img.image=[UIImage imageNamed:@"circle_default_status"];
                        
                    }else{
                        
                        img.image=[UIImage imageNamed:@"circle_current_status"];
                        
                    }
                }
            }
        }
    }
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
